{% extends "base.html" %}
{% load staticfiles  lptstags %}
{% block title %}  <title>Reports</title>  {% endblock%}
{% block css%}
	{{ block.super }}
	<link rel="stylesheet"  href="{% static "lpts/css/popup.css" %}" />
{%endblock%}

{% block contents%}
<div id="reports">
	<div id="opreation" class="fullcontent">
		<!-- <ul>
			<li><a  href=“/report/import”>导入</a>
		</ul> -->
	</div>
	<div  id="reportcontent">
		<div  id="reportleft" class="leftcontent">
			<div id="searchcontainer">
				<h2>搜索:</h2>
				<p>搜索右方有关列的关键词</p>
				<form  method="GET">
					<div  class="wrap">
						<input type="text" name="q"    value="{{query|escape}} "  class="winput">
						<button class="wbutton" >查询</button>
					</div>
				</form>
			</div>
			
			<div id="filtercontainer">
				<h2>过滤:</h2>
				<p>过滤操作系统名称</p>
				<form method="get">
					{% csrf_token%}
					{#{ osfilterform.as_ul}#}
					<div class="dropdown">{{ osfilterform.os }}</div>
					<div style="text-align:right;" >
				 		<button style="height:30px;width:50px; margin:2px 5px;" >确定</button>
				 	</div>
				</form>
			</div>
		</div>
		<div  id="reportright" class="rightcontent">
			<div id=tablecontainer>
				<div id="blanket"  style="display:none;"></div>
				<table class="bordered">
					<tr>
						<th>任务ID</th>
						<th>任务名称</th>
						<th>硬件型号</th>
						<th>操作系统</th>
						<th>测试场景</th>
						<th>测试员</th>
						<th>测试时间</th>
						<!--  <th>测试环境</th>-->
					</tr>
					{% for job_object in Job_objects %}
					<tr>
						<td><a href="{% url  'results'  job_object.jobid %}"  >{{job_object.jobid}}</a></td>
						<td>{{job_object.name}}</td>
						<td>
							<div id="{{job_object.hardware}}"  class="popUpDiv"  style="display:none;">
								<div >
									<table class="bordered">
										<tr>
											<th>名称</th>
											<td>{{job_object.hardware.name}}</td>
										</tr>
										<tr>	
											<th>CPU</th>
											<td>{{job_object.hardware.cpu}}</td>
										</tr>
										<tr>
											<th>Memory</th>
											<td>{{job_object.hardware.memory}}</td>
										</tr>
										<tr>
											<th>磁盘</th>
											<td>{{job_object.hardware.disk}}</td>
										</tr>
										<tr>
											<th>网络</th>
											<td>{{job_object.hardware.network}}</td>
										</tr>
										<tr>
											<th>其他</th>
											<td>{{job_object.hardware.others}}</td>
										</tr>
									</table>
								</div>
								<div style="text-align:center;"><button   href="#" onclick="popup('{{job_object.hardware}}')" >关闭</button></div>
    						</div>
    						<a href="#" onclick="popup('{{job_object.hardware}}')">{{job_object.hardware}}</a>
						</td>
						<td>
							<div id="{{job_object.os}}"  class="popUpDiv"  style="display:none;">
								<div >
									<table class="bordered">
										<tr>
											<th>名称</th>
											<td>{{job_object.os.name}}</td>
										</tr>
										<tr>	
											<th>版本号</th>
											<td>{{job_object.os.release}}</td>
										</tr>
										<tr>
											<th>小版本号</th>
											<td>{{job_object.os.version}}</td>
										</tr>
										<tr>
											<th>架构</th>
											<td>{{job_object.os.arch.name}}</td>
										</tr>
										<tr>
											<th>厂商</th>
											<td>{{job_object.os.vendor}}</td>
										</tr>
										<tr>
											<th>备注</th>
											<td>{{job_object.os.descriptions}}</td>
										</tr>
									</table>
								</div>
								<div style="text-align:center;"><button   href="#" onclick="popup('{{job_object.os}}')" >关闭</button></div>
    						</div>
    						<a href="#" onclick="popup('{{job_object.os}}')">{{job_object.os}}</a>
						</td>
						<td>
							<div id="{{job_object.scenegroup}}"  class="popUpDiv" style="display:none;">
								<table class="bordered">
									<tr>
										<th>名称</th>
										<th>测试内容</th>
										<th>测试分类</th>
										<th>测试工具</th>
										<th>并行数</th>
										<th>测试次数</th>
										<th>主要参数</th>
										<th>描述</th>
									</tr>
									{% for scene in job_object.scenegroup|getmtm:"scenes" %}
									<tr>
										<td>{{ scene.name}}</td>
										<td>{{ scene.testcontent}}</td>
										<td>{{ scene.testclass}}</td>
										<td>{{ scene.tool}}</td>
										<td>{{ scene.parallels}}</td>
										<td>{{ scene.times}}</td>
										<td>{{ scene.mainparas}}</td>
										<td>{{ scene.descriptions}}</td>
									</tr>
									{% endfor %}
								</table>
								<div style="text-align:center;"><button   href="#"  onclick="popup('{{job_object.scenegroup}}')" >关闭</button></div>
							</div>
							<a href="#" onclick="popup('{{job_object.scenegroup}}')">{{job_object.scenegroup}}</a>
						</td>
						<td>
							<div id="{{job_object.tester.name}}"  class="popUpDiv" style="display:none;">
								<div>
									<table class="bordered">
										<tr>
											<th>名称</th>
											<td>{{job_object.tester.name}}</td>
										</tr>
										<tr>
											<th>职位</th>
											<td>{{job_object.tester.position}}</td>
										</tr>
										<tr>
											<th>公司</th>
											<td>{{job_object.tester.company}}</td>
										</tr>
										<tr>
											<th>邮箱</th>
											<td>{{job_object.tester.mail}}</td>
										</tr>
										<tr>
											<th>联系电话</th>
											<td>{{job_object.tester.telephone}}</td>
										</tr>
									</table>
								</div>
								<div style="text-align:center;"><button   href="#" onclick="popup('{{job_object.tester.name}}')" >关闭</button></div>
							</div>
							<a href="#" onclick="popup('{{job_object.tester.name}}')">{{job_object.tester}}</a>
						</td>
						<td>{{job_object.time|date:"Y/m/d H:i:s"}}</td>
						<!-- <td><a href="">Detail</a></td> -->
					</tr>
					{% endfor %}
				</table>
			</div>
			<div  id="pagefilter">
                {% if Job_objects.has_previous %}
                    <a   href='?page=1'><span> 首页 </span></a>
                    <a   href='?page={{ Job_objects.previous_page_number }}'><span> 上一页 </span></a>
                    {% else %}
                    <a   href='?page=1'><span> 首页 </span></a>
                    <a   href='?page=1'><span> 上一页 </span></a>
                    {% endif %}
                    <span> {{ Job_objects.number}}/{{Job_objects.paginator.num_pages}} </span>
                    {% if Job_objects.has_next %}
                    <a  href='?page={{ Job_objects.next_page_number }}'><span>下一页 </span></a>
                    <a  href='?page={{Job_objects.paginator.num_pages}}'><span> 末页 </span></a>
                    {%else%}
                    <a  href='?page={{ Job_objects.paginator.num_pages }}'><span> 下一页 </span></a>
                    <a  href='?page={{Job_objects.paginator.num_pages}}'><span> 末页 </span></a>
                    {% endif %}
              </div>
		</div>
	    <br style="clear:both;" />
	</div>
	<br style="clear:both;" />
</div>
{% endblock %}

